Repository navigation
chore(spanner): bound streaming server retry delays and fall back on non-positive values - #15074
Open
sakthivelmanii wants to merge 2 commits into
Open
sakthivelmanii wants to merge 2 commits into
sakthivelmanii wants to merge 2 commits into
Conversation
…non-positive values Sanitize server-supplied RetryInfo delays when resuming interrupted Cloud Spanner streaming reads and queries so zero, negative, or oversized retry trailers cannot trigger zero-delay retry spin loops or stall consumer threads for hours. - Fall back to exponential backoff (>= 1 ms) when a server retry delay is zero, sub-millisecond, or negative instead of retrying immediately without sleeping. - Cap positive server retry delays at the configured maximum retry delay on streaming retry settings (defaulting to 1000 ms when unset or non-positive) before evaluating the remaining total timeout budget. - Use the same 1000 ms ceiling for client-side exponential backoff when maximum retry delay is unset on streaming retry settings.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates ResumableStreamIterator to improve the handling of server-supplied retry delays and backoff configurations. Positive server-supplied retry delays are now capped at the configured maximum retry delay (defaulting to 1000ms if unset or non-positive), while missing, zero, or negative delays correctly fall back to exponential backoff. It also introduces robust handling for sub-millisecond durations and potential arithmetic overflows when converting durations to milliseconds. Comprehensive unit tests have been added to verify these edge cases. I have no feedback to provide as there are no review comments.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sanitize server-supplied
RetryInfodelays when resuming interrupted Cloud Spanner streaming reads and queries so zero, negative, or oversized retry trailers cannot trigger zero-delay retry spin loops or stall consumer threads for hours.>= 1 ms) when a server retry delay is zero, sub-millisecond, or negative instead of retrying immediately without sleeping.1000 mswhen unset or non-positive) before evaluating the remaining total timeout budget.1000 msceiling for client-side exponential backoff when maximum retry delay is unset on streaming retry settings.